]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Focusing the text entry should force chats to stay open
authorDebarshi Ray <debarshir@gnome.org>
Wed, 5 Sep 2012 16:59:50 +0000 (18:59 +0200)
committerDebarshi Ray <debarshir@gnome.org>
Thu, 6 Sep 2012 10:05:54 +0000 (12:05 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=682236

js/ui/components/telepathyClient.js
js/ui/messageTray.js

index a6abeb193c435ca62f4904f909c5ca2b783f0eda..d0137ac5767c26b3032bf99c23b94d84ba324b9a 100644 (file)
@@ -756,6 +756,14 @@ const ChatNotification = new Lang.Class({
         this._responseEntry.clutter_text.connect('text-changed', Lang.bind(this, this._onEntryChanged));
         this.setActionArea(this._responseEntry);
 
+        this._responseEntry.clutter_text.connect('key-focus-in', Lang.bind(this, function() {
+            this.focused = true;
+        }));
+        this._responseEntry.clutter_text.connect('key-focus-out', Lang.bind(this, function() {
+            this.focused = false;
+            this.emit('unfocused');
+        }));
+
         this._oldMaxScrollAdjustment = 0;
         this._createScrollArea();
         this._lastGroup = null;
index 42ce76a5d36cbc36e9098074362f2ad12cfac202..614842e513774bd70bce5da7835c7e7f52ee5486 100644 (file)
@@ -318,6 +318,7 @@ const Notification = new Lang.Class({
         // 'transient' is a reserved keyword in JS, so we have to use an alternate variable name
         this.isTransient = false;
         this.expanded = false;
+        this.focused = false;
         this.showWhenLocked = false;
         this.acknowledged = false;
         this._destroyed = false;
@@ -1913,6 +1914,7 @@ const MessageTray = new Lang.Class({
         let notificationExpanded = this._notification && this._notification.expanded;
         let notificationExpired = this._notificationTimeoutId == 0 &&
                                   !(this._notification && this._notification.urgency == Urgency.CRITICAL) &&
+                                  !(this._notification && this._notification.focused) &&
                                   !this._pointerInTray &&
                                   !this._locked &&
                                   !(this._pointerInKeyboard && notificationExpanded);
@@ -2125,6 +2127,9 @@ const MessageTray = new Lang.Class({
                                                               Lang.bind(this, this._onIdleMonitorWatch));
         this._notificationClickedId = this._notification.connect('done-displaying',
                                                                  Lang.bind(this, this._escapeTray));
+        this._notification.connect('unfocused', Lang.bind(this, function() {
+            this._updateState();
+        }));
         this._notificationBin.child = this._notification.actor;
 
         this._notificationWidget.opacity = 0;